package cn.edu.xmu.oomall.customer.model.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

@Data
/**
 * @author Jiazhe Yuan
 * @date 2021-12-14 12:24:03
 */
public class NewCustomerVo {

    @Pattern(regexp="[+]?[0-9*#]+",message="手机号格式不正确")
    @NotBlank(message = "手机号不能为空")
    private String mobile;

    @Email(message = "email格式不正确")
    @NotBlank(message = "email不能为空")
    private String email;

    @Length(min = 6, message = "用户名长度过短")
    @NotBlank(message = "用户名不能为空")
    private String userName;

    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&#])[A-Za-z\\d@$!%*?&#]{8,}$",message = "密码格式不正确，请包含大小写字母数字及特殊符号")
    @NotBlank(message = "请输入密码")
    private String password;

    @NotBlank(message = "真实姓名不能为空")
    private String name;
}
